package com.xdtech.hotel.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.xdtech.core.model.BaseModel;

/**
 * 
 * @author max.zheng
 * @create 2015-04-04 11:12:27
 * @since 1.0
 * @see 
 */
@Entity
@Table(name="HOTEL_DEVICE_LINK")
public class DeviceLink extends BaseModel implements Serializable{
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	@Column(name="LID")
	private String lid;
	@Column(name="LTYPE")
	private String ltype;
	@Column(name="ADDR")
	private String addr; // ” : “0”, #可选参数：0-255，设备地址；
	@Column(name="CHANNEL")
	private String channel; // ” : “0”, #可选参数：0-255,设备通道；
	@Column(name="COMPONENT")
	@Lob
	private String component;
	
//	@ManyToOne
//	@JoinColumn(name = "DEVICE_ID")
//	private Device device;
	
//	@OneToMany(mappedBy="deviceLink")
//	private List<DeviceLinkOption> deviceLinkOptions = new ArrayList<DeviceLinkOption>();

	
	public DeviceLink()
	{
		super();
	}
	
	
	public DeviceLink(String lid, String ltype)
	{
		super();
		this.lid = lid;
		this.ltype = ltype;
	}


	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	public void setLid(String lid) {
		this.lid = lid;
	}
	public String getLid() {
		return lid;
	}
	public void setLtype(String ltype) {
		this.ltype = ltype;
	}
	public String getLtype() {
		return ltype;
	}
	public String getComponent()
	{
		return component;
	}
	public void setComponent(String component)
	{
		this.component = component;
	}


	public String getAddr() {
		return addr;
	}


	public void setAddr(String addr) {
		this.addr = addr;
	}


	public String getChannel() {
		return channel;
	}


	public void setChannel(String channel) {
		this.channel = channel;
	}
	
//	public Device getDevice() {
//		return device;
//	}
//	public void setDevice(Device device) {
//		this.device = device;
//	}
//	public List<DeviceLinkOption> getDeviceLinkOptions() {
//		return deviceLinkOptions;
//	}
//	public void setDeviceLinkOptions(List<DeviceLinkOption> deviceLinkOptions) {
//		this.deviceLinkOptions = deviceLinkOptions;
//	}
	
	
}
